package com.parkingspace.controller;


import com.parkingspace.entity.ParkingInformation;
import com.parkingspace.service.IParkingInformationService;
import com.parkingspace.util.Constants;
import com.parkingspace.util.ResultVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 车位信息表 前端控制器
 * </p>
 *
 * @author Gapper
 * @since 2021-05-24
 */
@RestController
@RequestMapping("/parking-information")
public class ParkingInformationController {
        @Resource
        private IParkingInformationService iParkingInformationService;

        @PostMapping("initp")
        public ResultVO getParking(){
            List<ParkingInformation> parkings = iParkingInformationService.getAllParking();
            return new ResultVO(Constants.OPER_SUCCESS,"所有车位信息",parkings);
        }

}

